﻿using System;
using System.Linq;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using Newtonsoft.Json;
using SnakeGame.Models;
using SnakeGame.Views;
using SnakeGame.Helpers;

namespace SnakeGame.ViewModels
{
    public class DialogTemplateViewModel : NotifyPropertyChanged
    {
        public ICommand OkCommand { get; set; }
        public ICommand CancelCommand { get; set; }
        public event EventHandler RequestClose;

        public DialogTemplateViewModel()
        {
            OkCommand = new RelayCommand(OnOkCommand);
            CancelCommand = new RelayCommand(OnCancelCommand);
        }

        protected virtual void OnOkCommand(object obj)
        {
            OnRequestClose();
        }

        protected virtual void OnCancelCommand(object obj)
        {
            OnRequestClose();
        }

        protected virtual void OnRequestClose()
        {
            if (RequestClose != null)
            {
                RequestClose(this, EventArgs.Empty);
            }
        }

    }
}
